package com.cgw.room.tools;

import android.util.Log;

public class ByteOrderOperator {
    public static void changeByteOrder(byte[] ba, int step){
        assert step % 2 == 0;
        assert ba.length % 2 == 0;

        for (int n = 0; n < ba.length; n += step){
            byte c = 0;
            for (int s = 0; s < step / 2; ++s){
                c = ba[n + s];
                ba[n + s] = ba[n + step - s - 1];
                ba[n + step - s - 1] = c;
            }
        }
    }
}
